<template>
  <div class="list_all">
    <template>
      <el-tabs v-model="activeName" type="border-card">
        <el-tab-pane label="列表设置" name="first">
          <div class="redact-from" style="padding:10px 40px;">
            <!-- <div class="style-cont">
            <div class="txt">
              <span>列表行业:</span>
            </div>
            <template>
              <select v-model="value" placeholder="请选择">
                <option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                ></option>
              </select>
            </template>
            </div>-->
            <div class="style-cont">
              <div class="txt" style="width:90px;">
                <span>添加选项卡：</span>
              </div>
              <template>
                <el-button type="primary" size="small" @click="addTab">添加</el-button>
              </template>
            </div>
            <div class="style-cont" v-if="tabArray.length>0">
              <div class="txt" style="width:100px;"></div>
              <div class="father_box">
                <div class="addLink">
                  <div class="showdata" v-for="(item, index) in tabArray" :key="index">
                    <div class="showCont" @click="chooseLink(item, index)">{{item.title}}</div>
                    <div @click="deleteCard(index)">
                      <i class="el-icon-delete"></i>
                    </div>
                    &nbsp;&nbsp;
                    <div v-if="item.id" title="已绑定来源">
                      <i class="el-icon-star-on"></i>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div class="style-cont" v-if="tabArray.length>0">
              <div class="txt" style="width:0"></div>
              <div class="set_father_box">
                <div class="set_son_box">
                  <div class="buju">
                    <div class="txt text_rgt">标题:</div>
                    <el-input v-model="cardName" placeholder="请输入内容" size="small" style="flex:1"></el-input>
                  </div>
                  <div class="buju">
                    <div class="txt text_rgt">商品来源:</div>
                    <template style="flex:1">
                      <el-button
                        @click="dialogTableVisible = true,getsourceList()"
                        type="primary"
                        size="small"
                      >选择来源</el-button>
                    </template>
                  </div>
                </div>
              </div>
            </div>

            <!-- 弹窗选择链接 -->
            <el-dialog title="选择来源" :visible.sync="dialogTableVisible">
              <el-tabs tab-position="left" style="min-height: 200px;" v-model="activeSource">
                <el-tab-pane label="分类" name="first">
                  <div class="classContant">
                    <template v-for="(item, index) in classifyData">
                      <el-button @click="selectClass(item)" type="primary" plain size="small" :key="index">{{item.name}}</el-button>
                    </template>
                  </div>
                </el-tab-pane>
                <!-- <el-tab-pane label="分组" name="second">
                  <div class="classContant"></div>
                </el-tab-pane> -->
              </el-tabs>
            </el-dialog>
            <div class="style-cont">
              <div class="txt">
                <span>列表样式:</span>
              </div>
              <div class="img">
                <div
                  :class="['svgStyle', styleIdx === idx ? 'active': '' ]"
                  v-for="(item, idx) in listStyle"
                  :key="idx"
                  @click="setStyle(idx)"
                >
                  <img :src="item.img" alt />
                </div>
              </div>
            </div>
            <div class="style-cont">
              <div class="txt">
                <span>展示条数:</span>
              </div>
              <template>
                <el-radio v-model="showSort" label="1">固定</el-radio>
                <el-radio v-model="showSort" label="2">无限滚动</el-radio>
              </template>
            </div>
            <div class="style-cont" v-if="showSort==2">
              <div class="txt">
                <span>滚动方式:</span>
              </div>
              <template>
                <el-radio v-model="radio1" label="1">滑动</el-radio>
                <!-- <el-radio v-model="radio1" label="2">翻页</el-radio> -->
              </template>
            </div>
            <div class="style-cont" v-else-if="showSort==1">
              <div class="txt">
                <span>展示条数:</span>
              </div>
              <input type="text" v-model="showNumber" />
            </div>
            <!-- <div class="style-cont">
              <div class="txt">
                <span>列表宽高：</span>
              </div>
              <input type="number" v-model="listW" name id />
              <input type="number" v-model="listH" name id />
            </div>-->
            <!-- <div class="style-cont">
              <div class="txt">
                <span>列表圆角：</span>
              </div>
              <input type="text" v-model="listRound" name id />
            </div>-->
            <div class="style-cont">
              <div class="txt">
                <span>列表背景：</span>
              </div>
              <el-color-picker class="mycolor" size="small" v-model="listBg" show-alpha></el-color-picker>
            </div>
            <div class="style-cont">
              <div class="txt">
                <span>列表背景：</span>
              </div>
              <div class="choose-btn-img">
                <img :src="listBg" alt />
              </div>
              <img
                class="upimg"
                @click="showImg = true"
                src="@/assets/config_images/addimg.png"
                alt
              />
              <UploadImages
                @closeModel="closeModel"
                :dialogVisible="showImg"
                @changeImg="changeImg"
              ></UploadImages>
            </div>
          </div>
        </el-tab-pane>
        <el-tab-pane label="颜色设置" name="second">
          <div class="setStyle">
            <el-row :gutter="10">
              <el-col :span="7">
                <div class="grid-content">标题颜色：</div>
              </el-col>
              <el-col :span="16">
                <div class="grid-content">
                  <el-color-picker v-model="titleColor" size="small"></el-color-picker>
                </div>
              </el-col>
            </el-row>
            <el-row :gutter="10">
              <el-col :span="7">
                <div class="grid-content">金额颜色：</div>
              </el-col>
              <el-col :span="16">
                <div class="grid-content">
                  <el-color-picker v-model="priceColor" size="small"></el-color-picker>
                </div>
              </el-col>
            </el-row>
            <el-row :gutter="10">
              <el-col :span="7">
                <div class="grid-content">评价颜色：</div>
              </el-col>
              <el-col :span="16">
                <div class="grid-content">
                  <el-color-picker v-model="evalColor" size="small"></el-color-picker>
                </div>
              </el-col>
            </el-row>
          </div>
        </el-tab-pane>
      </el-tabs>
      <!-- 列表属性 -->
      <!-- 编辑列表 -->
    </template>
  </div>
</template>

<script src="./ListData.js"></script>

<style lang="scss" scoped>
.grid-content {
  display: flex;
  align-items: center;
  border-radius: 4px;
  min-height: 36px;
  line-height: 36px !important;
}
@import "./LisStyle.scss";
.father_box {
  max-height: 150px;
  width: 100%;
  overflow: auto;
}
.set_father_box {
  height: auto;
  // width: 100%;
  flex: 1;
  overflow: auto;
  .buju {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-bottom: 10px;
    .text_rgt {
      margin-right: 20px !important;
      text-align: left;
    }
  }
}
.setStyle {
  height: 100%;
}
.classContant {
  width: 100%;
  min-height: 150px;
  text-align: left;
}
</style>

<style lang="scss">
.list_all {
  .el-color-picker--small {
    height: 18px;
  }
  // tab栏设置
  // .el-tabs__nav-scroll {
  //   padding-left: 20%;
  // }
  // .el-collapse-item__content {
  //   padding-bottom: 10px;
  // }
  // .el-tabs__header {
  //   margin-left: 15px;
  // }
  // .el-collapse-item__header,
  // .el-collapse-item__wrap,
  // .el-collapse {
  //   border: 0;
  // }
  // .el-tabs__nav-wrap::after,
  // .el-tabs__active-bar {
  //   // background-color: transparent;
  // }

  // 导航高度
  .el-tabs__nav-scroll {
    line-height: normal;
  }
  // 颜色
  .el-color-picker--small .el-color-picker__trigger {
    padding: 0;
    height: 18px;
    width: 40px;
    border-radius: 9px;
    overflow: hidden;
    .el-color-picker__color {
      border: 0;
    }
  }
  // 文本
  .text-all {
    .select {
      input {
        height: 34px;
        line-height: 34px;
      }
    }
  }
  // 按钮
  .btn {
    .btn-all {
      .select {
        input {
          height: 34px;
          line-height: 34px;
        }
      }

      .el-tabs__nav-wrap {
        padding-left: 130px;
      }
      .el-color-picker--small {
        height: 18px;
        margin-left: 10px;
      }
      .el-color-picker--small .el-color-picker__trigger {
        padding: 0;
        height: 18px;
        width: 40px;
        border-radius: 9px;
        overflow: hidden;
        .el-color-picker__color {
          border: 0;
        }
      }
      .el-tabs__header {
        margin: 0;
      }
    }
  }
  // 时间
  .time {
    .el-date-editor--time-select {
      width: 114px;
      .el-input__inner {
        padding: 0 20px 0 30px;
        height: 30px;
        line-height: 30px;
      }
      .el-input__icon {
        line-height: 30px;
      }
    }
    .select {
      input {
        height: 34px;
        line-height: 34px;
      }
      .el-input__icon {
        line-height: 34px;
      }
    }
  }
  .inventory,
  .grade,
  .price {
    .select {
      input {
        height: 34px;
        line-height: 34px;
      }
      .el-input__icon {
        line-height: 34px;
      }
    }
  }
}
</style>
